package com.hl.implic

/**
  * Created by yuanhailong on 2021/10/10.
  */
object ImplicitValue {


  def sayHi()(implicit name:String="hailong"): Unit ={
    println(s"hi ~  :${name}")
  }

  def main(args: Array[String]): Unit = {
    //导入隐式值
    import Context._
    //由于导入了隐式值，会匹配类型为String的隐式值
    sayHi()
  }

}


object Context{
  implicit val a:String="yuanyucheng"
}
